# -*- mode: snippet -*-
# name: EnvStats::tolIntNormN template, Sample Size, ci width with tolerance
# key: envstats.tolintnormn.template
# contributor: Shuguang Sun
# --
hw <- ${1:log(1/0.7)}
cv <- ${2:0.4}
sd <- sqrt(log(1 + $2^2))
chance <- ${3:0.7}
alpha <- ${4:0.1}
${99:nsz} <- EnvStats::tolIntNormN(
  half.width = hw,
  sigma.hat = sd,
  coverage = chance,
  cov.type = "content",
  conf.level = 1-alpha,
  ## method = "wald.wolfowitz",
  round.up = TRUE, n.max = 50000000,
  tol = 1e-07,
  maxiter = 1000
)
$99